from django.db import models
from myapp.models import User


class Cate(models.Model):

	name = models.CharField(max_length=255)
	pid = models.IntegerField()
	approver = models.CharField(max_length=255)

	class Meta:
		db_table = "cate"

	def __str__(self):
		return self.name


class TypeDemo(models.Model):

	pid = models.ForeignKey(Cate, on_delete=models.CASCADE)
	admin_fields = models.CharField(max_length=255)

	class Meta:
		db_table = "typedemo"

	def __str__(self):
		return self.name


class WorkOrder(models.Model):

	uid = models.IntegerField()
	alist = models.CharField(max_length=255)
	formdata = models.CharField(max_length=255)
	tid = models.IntegerField()
	status = models.IntegerField(default=0)

	class Meta:
		db_table = "workorder"


class Message(models.Model):

	uid = models.IntegerField()
	wid = models.IntegerField()
	tid = models.IntegerField()
	is_read = models.IntegerField()

	class Meta:
		db_table = "message"


